﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Automobile.service.DAL;
using Automobile.service.Model;
using Automobile.service.Common;
using System.Data;
namespace Automobile.service.BLL
{
   public class PurchaseBLL
    {
       PurchaseDAL DAL = new PurchaseDAL();
        /// <summary>
        /// 添加采购进货订单
        /// </summary>
        /// <returns></returns>
        public int AddPurchase(Purchases pu, string xml)
        {
            return DAL.AddPurchase(pu,xml);
        }

        /// <summary>
        /// 查询订单信息(根据日期区间)
        /// </summary>
        /// <returns></returns>
        public List<Purchases> SearchPurchaseByDate(int index, int size, string firstdate, string lastdate,out int count)
        {
            return DAL.SearchPurchaseByDate(index, size,firstdate,lastdate,out count);
        }
        /// <summary>
        /// 根据订单编号查询相应的商品信息
        /// </summary>
        /// <returns></returns>
        public string GetPurchaseMateByPurchase_Id(int Purchase_Id)
        {
            return DAL.GetPurchaseMateByPurchase_Id(Purchase_Id);
        }
        /// <summary>
        /// 根据编号获取仓库，供货商，下单人的信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public string GetPurchaseByid(int id)
        {
            return DAL.GetPurchaseByid(id);
        }
        public int Proc_Ruku(int id)
        {
            return DAL.Proc_Ruku(id);
        }
        
    }
}
